<template>
	<view class="container">
		<view class="absolute-video">
			<video-player class="video-player" />
			<advertise></advertise>
		</view>

		<!-- 滚动的内容 -->
		<view class="content">
			<view class="block-a"></view>
			<view class="block-b"></view>
			<teacher-about></teacher-about>
			<title1></title1>
			<social-bar></social-bar>
			<push-cards></push-cards>
		</view>
	</view>
</template>

<script>
	import VideoPlayer from './video_player.vue';
	import Advertise from './advertise.vue';
	import TeacherAbout from './teacher_about.vue';
	import SocialBar from './social_bar.vue';
	import Title1 from './title1.vue';
	import pushCards from './push_cards.vue'

	export default {
		components: {
			VideoPlayer,
			Advertise,
			TeacherAbout,
			SocialBar,
			Title1,
			pushCards
		},
		data() {
			return {
				statusBarHeight: 0 // 存储状态栏高度
			};
		},
onLoad() {
  // 获取系统信息，获取状态栏高度
  this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;

  // 请求视频详细信息
  uni.request({
    url: `http://localhost:8006/user/getVideoInfo?videoId=${this.$store.state.videoAbout.videoId}`,
    method: 'GET',
    success: (res) => {
      if (res.data.statusCode === 200) {
        this.$store.commit('setVideoAbout', res.data.data);
		console.log('请求成功：', res);
      } else {
        console.error('请求失败：', res);
      }
    },
    fail: (err) => {
      console.error('请求错误：', err);
    }
  });
}

		
		
	};
</script>

<style scoped>
	.container {
		position: relative;
	}
	.block-b{
		height:66vw
	}
	.block-a {
		height: 130px
	}

	/* 将视频播放器固定在顶部，添加动态顶部留白 */
	.absolute-video {
		position: fixed;
		top: 0;
		width: 100%;
		z-index: 1;
		background-color: white;
		/* 设置背景色，避免滚动时内容透出 */
		/* 阻止手指滑动事件 */
		touch-action: none;
	}

	/* 内容区域从视频播放器下方开始 */
	.content {
		padding: 10px;
		overflow-y: auto;
		/* 启用内容区域的滚动 */
	}

	/* 其他样式保持不变 */
	.block-video {
		width: 100vw;
		height: 660vw;
	}

	.block-advertise {
		height: 75px;
		padding: 10px;
	}
</style>